import 'package:flutter/material.dart';
import 'data_source/data.dart';
class ListViewDetailDemo extends StatefulWidget{
  final ImageDemo imageDemo;
  const ListViewDetailDemo(this.imageDemo);
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _ListViewState(this.imageDemo);
  }
}
class _ListViewState extends State<ListViewDetailDemo>{
  final ImageDemo imageDemo;
   _ListViewState(this.imageDemo);
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text(imageDemo.name),
      ),
      body: Container(
        padding: EdgeInsets.all(10.0),
        margin: EdgeInsets.only(bottom: 20),
        child: Column(
          children: <Widget>[
            Image.network(imageDemo.url,fit: BoxFit.contain,),
            SizedBox(height: 10.0,),
            Text(imageDemo.author,
              style: TextStyle(
                fontSize: 15.0,
                fontWeight: FontWeight.w300,
              ),),
            Text(imageDemo.desc,
              style: TextStyle(
                  color: Colors.grey
              ),
            ),
          ],
        ),
      ),
    );
  }
  @override
  void initState() {
    // TODO: implement initState
    debugPrint("[${imageDemo.name}]list_detail init!");
  }

  @override
  void dispose() {
    // TODO: implement dispose
    debugPrint("[${imageDemo.name}]list_detail dispose!");
  }
}